package com.wtwd.campus.receiver;

import com.wtwd.campus.service.IRMFeignClientService;
import com.wtwd.campus.service.InjectFeignService;
import com.wtwd.campus.utils.LocationUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SetCirclePositionReceiver implements Receiver {
    @Autowired
    private IRMFeignClientService irmFeignClientService;
    @Override
    public String parseMessage(String data) {
//        //        String str = data.substring(0, data.length() - 1); //将指令末尾的#截取掉
//        //分割字符串获取指令信息
//        String[] split = data.split(",");
//        int length=split.length;
//        String imei=split[1];
//        String commandNumber=split[4];
//        // 删除redis的指令
//        completeCommand(imei,commandNumber);
//        int index=(length-6)/4;//总的长度减去指令中其他信息，算出有几组信息
//        //存放所有的信息
//        List<Map<String,String>> list=new ArrayList<>();
//        for(int j=1;j<=index;j++){
//            Map<String,String> map=new HashMap<>();
//            //将经纬度转换成double
//            List<Double> doubles = LocationUtils.transiformLatAndLng(split[4 + (j - 1) * 4 + 3], split[4 + (j - 1) * 4 + 2]);
//            map.put("postId",split[4+(j-1)*4+1]);
//            map.put("postLat",String.valueOf(doubles.get(1)));
//            map.put("postLon",String.valueOf(doubles.get(0)));
//            map.put("radius",split[4+(j-1)*4+4]);
//            list.add(j-1,map);
//        }
//        return imei;
        return null;
    }
}
